package tagdb.model;

import com.compomics.util.experiment.biology.Protein;
import tagdb.algorithm.tag.Tag;

/**
 * <b>SuspectHit</b>
 * <p>
 * This class represents the object for a suspected tag-to-spectrum match, i.e.
 * the tag was matched correctly and the precursor mass delta was under the threshold.
 * </p>
 *
 * @author T.Muth
 */
public class SuspectHit {

    /**
     * The FASTA protein entry.
     */
    private Protein protein;

    /**
     * The spectrum title.
     */
    private String spectrumTitle;

    /**
     * The suspected peptide.
     */
    private Peptide peptide;

    /**
     * The generated sequence tag.
     */
    private Tag tag;

    /**
     * Constructs a suspect hit.
     *
     * @param protein       The FASTA protein entry.
     * @param spectrumTitle The spectrum title.
     * @param peptide       The peptide.
     * @param tag           The sequence tag.
     */
    public SuspectHit(Protein protein, String spectrumTitle, Peptide peptide, Tag tag) {
        this.protein = protein;
        this.spectrumTitle = spectrumTitle;
        this.peptide = peptide;
        this.tag = tag;
    }

    /**
     * Returns the FASTA protein entry.
     *
     * @return The FASTA protein entry.
     */
    public Protein getProtein() {
        return protein;
    }

    /**
     * Returns the spectrum title.
     *
     * @return The spectrum title.
     */
    public String getSpectrumTitle() {
        return spectrumTitle;
    }

    /**
     * Returns the peptide.
     *
     * @return The peptide.
     */
    public Peptide getPeptide() {
        return peptide;
    }

    /**
     * Returns the sequence tag.
     *
     * @return The sequence tag.
     */
    public Tag getTag() {
        return tag;
    }

    /**
     * Checks whether the suspect hit is decoy or not.
     * @return Suspect hit being decoy or not.
     */
    public boolean isDecoy() {
        return protein.isDecoy();
    }
}
